#pragma once
#include "Block.h"
#include "Camera.h"

class Player 
{
public:
		Player(void);
		~Player(void);
		HRESULT Render();
		bool Load(char * filename); // load x.file
		bool Collides(const D3DXVECTOR3 pt, float radius);
		void RotateMesh(const D3DXVECTOR3 direction);
		void moveTo(const D3DXVECTOR3 location);

		void moveForward(bool boosted);
		void moveBackward(bool boosted);
		void turnLeft();
		void turnRight();

		const D3DXVECTOR3 getForwardDirection();

		void setSpeed(float spd);

		// point to the mesh object
		LPD3DXMESH m_mesh;
		ID3DXMesh* player;
		DWORD numMaterials;            // Note: DWORD is a typedef for unsigned long		
	
		D3DMATERIAL9 *meshMaterials;
		LPDIRECT3DTEXTURE9 *meshTextures;

		Camera camera;
		Block* block;
		D3DXVECTOR3 m_Dir;

		float m_fAngle; // rotation angle
		float m_fTurnSpd;
		float m_fMovSpd;
};